﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using SupervisorController;
namespace SupervisorGUI
{
    /// <summary>
    /// Interaction logic for BroadcastWindow.xaml
    /// </summary>
    public partial class BroadcastWindow : Window
    {
        Cls_SupervisorController supervisorController;

        public BroadcastWindow(Cls_SupervisorController supervisorController)
        {
            InitializeComponent();
            this.supervisorController = supervisorController;
        }

        private void btnMessage_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string message;
                string groupName;

                message = txtBroadcastMessage.Text;
                groupName = txtBroadcastGroup.Text;

                supervisorController.CreateMessage(message, groupName);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


        }
    }
}
